<!--
	作者：2575202388@qq.com
	时间：2018-10-14
	描述：社团活动辅导班管理
-->

<template>
	<div style="width:100%;">
		<div style="background: #fff;">
			<div style="width:100%;float:left;padding-top: 10px;padding-bottom: 10px;">
				<div style="text-align: right;float:left;line-height:32px;padding-left:10px;">辅导班名称：</div>
				<div style="width:15%;float:left;">
					<Input v-model="tj.mc"  clearable  style="width: 90%;float:left;" />
				</div>
				
				<div style="width:30%;text-align: left;float:left;">
					<Button v-on:click="search()" style="margin-left:1%;background: #ffa500;color:#fff;border:1px solid #ffa500;">搜索</Button>
					<Button v-on:click="huifu()" icon="md-add" type="primary" style="background-color: #3fc1c9;border:1px solid #3fc1c9;">移出历史库</Button>
				</div>
			</div>
		</div>
		<div>
			<ss :tj="tj" ref="sthdfdbss"  @getSelection="getSelection"></ss>
		</div>

	</div>
</template>

<script>
	import ss from "./ss";
	export default {
		name: "sthdfdbmange",
		data() {
			return {
				tj: {
					mc:'',//社团活动辅导班名称
					sstate:'1'
				},
				selects:[],
			}
		},
		methods: {
			search(){
				this.$refs.sthdfdbss.load();
			},
			
			getSelection(selects){
	      		this.selects=[...selects];
	      	},
	    	huifu(){
	      		var warr=[];
	      		const sels=this.selects;
	      		for(var i=0;i<sels.length;i++){
	      			const sel={
	      				sid:sels[i].SID
	      			}
	      			warr.push(sel);
	      		}
	      		if(warr.length<=0){
	      			this.$Modal.error({
                        title: "提示",
                        content: "请选择需要移出历史库的报名！"
                   });	
                   return;
	      		}
	      		const params={
					sids:JSON.stringify(warr),
				};
                this.$http.post("/host/stgl/sthd/resHistoryStkfdb.html",params)
				.then(result => {
					if(result){
						this.$Modal.success({
                            title: "提示",
                            content: "移出历史库成功！"
                      });
                       this.search();
					}else{
						this.$Modal.error({
                            title: "提示",
                            content: "移出历史库失败！"
                        });	
					}
					
				});
				
	        },
		},
		components: {
			ss
		},
		mounted(){
		},
		watch:{
		},
		computed: {
		}
	}
</script>

<style>
</style>